package pactera.tf.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

@Component
public class ChatMsgProducer {
	@Autowired
    private KafkaTemplate<String, String> kafkaTemplate;
	/**
	 * 
	
	 * <p>Title: sendForPointToPoint</p>  
	
	 * <p>Description:点对点消息的发送 </p>  
	
	 * @param chatmsg
	 */
    public void sendForPointToPoint(String chatmsg){
          kafkaTemplate.send("chatMsg", chatmsg);
    }
    /**
     * 
    
     * <p>Title: sendForGroup</p>  
    
     * <p>Description: 群组消息的发送</p>  
    
     * @param chatmsg
     */
    public void sendForGroup(String chatmsg){
        kafkaTemplate.send("groupChatMsg", chatmsg);
  }
}
